<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<md-sidenav
  class="md-sidenav-left md-whiteframe-z2 md-sidenav-theme"
  md-component-id="left"
  md-is-locked-open="true"
  ng-class="{'md-sidenav-min': $ctrl.reducedMode}"
  style="overflow: inherit;">

  <md-list class="sidenav-list">
    <md-list-item ng-repeat="menuItem in $ctrl.menuItems|orderBy:'data.menu.order' track by menuItem.name">
      <md-tooltip md-delay="400">{{menuItem.data.menu.label}}</md-tooltip>
      <a ui-sref="{{ :: menuItem.name}}" ui-sref-opts="{inherit: false}" title="{{ :: menuItem.data.menu.label}}"
         ng-class="{'sidenav-active': $ctrl.isActive(menuItem)}">
        <ng-md-icon icon="{{ :: menuItem.data.menu.icon }}"></ng-md-icon>
        <span>{{ :: menuItem.data.menu.label }}</span>
      </a>
    </md-list-item>

    <gv-submenu all-menu-items="$ctrl.allMenuItems" reduced-mode="$ctrl.reducedMode"></gv-submenu>
  </md-list>

  <div class="sidenav-footer">
      <md-button
        class="md-fab md-mini sidenav-toggle"
        md-no-ink
        md-no-focus-style
        ng-click="$ctrl.toggleReducedMode()"
        aria-label="Mini FAB">
        <ng-md-icon class="sidenav-toggle-icon" size="16"
                    icon="{{$ctrl.reducedMode?'chevron_right':'chevron_left'}}"></ng-md-icon>
      </md-button>
  </div>
</md-sidenav>
